<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<ul>
    <li>AAA</li>
    <li>BBB</li>
    <li>CCC</li>
</ul>
<script>
    var i =0;//1
    while (i<3){//2
        //3
        console.log(i);
        //4
        i = i+1;
    }
    /*
     1
     2
     3
     4  i=1

     2
     3
     4  i=2

     2
     3
     4  i=3

     2
     */

    i = 1;
    var total = 0;
    while (i<=10){
        total = total + i;
        i++;
    }
    console.log(total);

    var arr = ['tom','frank','jack'];
    arr[0]
    arr[1]
    arr[2]
    i = 0;
    var l = arr.length;
    while(i< l){
        console.log(arr[i]);
        i++;
    }


    var lis = document.getElementsByTagName('li');
    console.log(lis);
    console.log("***************************");

    console.log(i);
    console.log(lis.length);
    i = 0;
    while (i<lis.length){
        console.log(lis[i]);
        i++;
    }


    console.log("***************************");

    i = 0;
    while (true){
        console.log(i);
        if(i==3){
            break;
        }
        i++;
    }

    /*
    1
    2
    3
    4  i=1

    2
    3
    4  i=2

    2
    3
    4  i=3

    2
     */

</script>
</body>
</html>